<script src="/static/kindeditor/kindeditor-all-min.js"></script>
<script charset="utf-8" src="/static/kindeditor/lang/zh-CN.js"></script>
<textarea name="content"  id="content" class="layui-textarea" style="height: 300px;">@if(isset($content)){{$content}}@endif</textarea>
<script>
    KindEditor.ready(function(K) {
        window.editor = K.create('#content',{
            filterMode : false,
            items :[
                'source', '|', 'undo', 'redo', '|', 'preview', 'template', 'cut', 'copy', 'paste',
                'plainpaste', 'wordpaste', '|', 'justifyleft', 'justifycenter', 'justifyright',
                'justifyfull', 'insertorderedlist', 'insertunorderedlist', 'indent', 'outdent', 'subscript',
                'superscript', 'clearhtml', 'quickformat', 'selectall', '|', 'fullscreen', '/',
                'formatblock', 'fontname', 'fontsize', '|', 'forecolor', 'hilitecolor', 'bold',
                'italic', 'underline', 'strikethrough', 'lineheight', 'removeformat', '|', 'image',
                'multiimage','flash', 'media','insertfile','table', 'hr', 'emoticons', 'baidumap', 'pagebreak',
                'anchor', 'link', 'unlink', '|', 'about'
            ],
            //fileManagerJson : '../asp.net/file_manager_json.ashx',
            //allowFileManager : true,
            uploadJson : '/admin/upload/article',
            allowFileManager: true,

            //经测试，下面这行代码可有可无，不影响获取textarea的值

            //afterCreate: function(){this.sync();}

            //下面这行代码就是关键的所在，当失去焦点时执行 this.sync();

            afterBlur: function(){
                this.sync();
            }
        });
    });
</script>